Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hash to end of resource names to avoid name clash #605

Merged

Conversation

KPostOffice
Copy link
Collaborator

Issue link

https://issues.redhat.com/browse/RHOAIENG-10129

What changes have been made

created a function which takes a string and appends the controller name to it then hashes it to use as a suffix for the resources created by this controller to avoid naming conflicts

Verification steps

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Copy link
Contributor

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the existing resources should be pruned, like during the operator upgrade. But I think that's acceptable.

pkg/controllers/raycluster_controller.go Outdated Show resolved Hide resolved
pkg/controllers/support.go Outdated Show resolved Hide resolved
@KPostOffice
Copy link
Collaborator Author

Ideally the existing resources should be pruned, like during the operator upgrade. But I think that's acceptable.

I had this thought too. I can try my hand at writing an upgrade strategy for this

@KPostOffice KPostOffice force-pushed the secret-clash-10129 branch 5 times, most recently from 42f243e to 33855ed Compare August 20, 2024 22:03
@astefanutti
Copy link
Contributor

I guess the new names should be reflected into Ray cluster the webhook.

@astefanutti
Copy link
Contributor

Overall LGTM, just left a comment on the hash seed, and to update the Ray cluster webhook accordingly.

@KPostOffice
Copy link
Collaborator Author

I guess the new names should be reflected into Ray cluster the webhook.

I think this is taken care of already by using the nameFromCluster functions in all the necessary places.

@astefanutti
Copy link
Contributor

I guess the new names should be reflected into Ray cluster the webhook.

I think this is taken care of already by using the nameFromCluster functions in all the necessary places.

Ah OK, I thought it could explain why the e2e failed.

@KPostOffice
Copy link
Collaborator Author

I guess the new names should be reflected into Ray cluster the webhook.

I think this is taken care of already by using the nameFromCluster functions in all the necessary places.

Ah OK, I thought it could explain why the e2e failed.

The tests also needed to be changed to use the fromCluster functions. I'm still messing around with them. I thought I caught everything but I'm still clearly missing something that needs to be fixed in the tests

@KPostOffice KPostOffice force-pushed the secret-clash-10129 branch 3 times, most recently from 42d9a82 to d9f9150 Compare August 21, 2024 20:07
@KPostOffice KPostOffice force-pushed the secret-clash-10129 branch 2 times, most recently from 5dd4666 to b1a1fda Compare August 22, 2024 20:16
@KPostOffice
Copy link
Collaborator Author

@astefanutti This should be g2g now

@KPostOffice KPostOffice force-pushed the secret-clash-10129 branch 2 times, most recently from 2b020b4 to eff323b Compare August 26, 2024 17:10
@KPostOffice KPostOffice force-pushed the secret-clash-10129 branch 2 times, most recently from 70f4778 to 4d57ade Compare August 26, 2024 21:00
Comment on lines 49 to 51
Annotations: map[string]string{
versionAnnotation: "0.0.0",
},
Copy link
Contributor

@sutaakar sutaakar Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this annotation from here?
RayCluster CR created by used or SDK won't have the annotation defined. To reproduce the behavior we shouldn't provide it here either.

@@ -46,6 +46,9 @@ func TestRayClusterWebhookDefault(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you set operator version into rcWebhook above?

},
},
Spec: rayv1.RayClusterSpec{},
}
validRayCluster := &rayv1.RayCluster{
Copy link
Contributor

@sutaakar sutaakar Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no action comment
Using annotation and functions for validRayCluster is correct as those values are set by default webhook.

also added a version annotation to raycluster for the CFO version

Signed-off-by: Kevin <[email protected]>
Copy link
Contributor

@sutaakar sutaakar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link

openshift-ci bot commented Sep 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astefanutti

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Sep 3, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 7f00118 into project-codeflare:main Sep 3, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants